<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>定位</title>
  <style>
    .father {
      width: 80vw;
      height: 50vw;
      border: 1px solid #000;
      /* 添加了position: relative;之后元素就以他作为参考依据 */
      position: relative;
      left: 10vw;
    }

    .one {
      width: 20vw;
      height: 10vw;
      background-color: orange;
      /* 开启定位之后，元素不占位，后面的内容 上去了 */
      /* position:absolute 开启之后 默认会以页面为参考的标准
        如果希望是父元素作为 参考依据
      */
      position: absolute;

      /* 距离 上下左右的距离 top,right,bottom,left */
      left: 30vw;
      top: 20vw;
      /* 层级 */
      z-index: 1;
    }

    .two {
      width: 20vw;
      height: 10vw;
      background-color: green;
      position: absolute;
      left: 35vw;
      top: 25vw;
    }
  </style>
</head>
<body>
  <div class="father">
    <div class="one">one</div>
    <div class="two">two</div>
  </div>
</body>
</html>